<?php
/**
 * about business basic message
 * edit by kim
 */
class b2c_ctl_admin_business_member extends desktop_controller{
	var $workground = 'b2c_ctl_admin_business';
	public function __construct($app)
    {
        parent::__construct($app);
		header("cache-control: no-store, no-cache, must-revalidate");
    }

	public function index(){
		$this->finder('b2c_mdl_business_basicmsg',array(
            'title'=>app::get('b2c')->_('基础信息'),
            'actions'=>array(
                         array('label'=>app::get('b2c')->_('添加供应商'),'href'=>'index.php?app=b2c&ctl=admin_business_basicmsg&act=addmsg','target'=>'dialog::{width:600,height:450,title:\''.app::get('b2c')->_('添加供应商').'\'}'),
                        ),
            'allow_detail_popup'=>true,
            'use_buildin_recycle'=>false,
            ));
	}

    function company_index(){
        if($_GET['action'] == 'export') $this->_end_message = '导出会员';
        //增加会员相关权限判断@lujy
        if($this->has_permission('addmember')){
            $custom_actions[] = array('label'=>app::get('b2c')->_('添加供应商'),'href'=>'index.php?app=b2c&ctl=admin_business_basicmsg&act=addmsg','target'=>'dialog::{title:\''.app::get('b2c')->_('添加供应商').'\',width:600,height:450}');
        }
        if($this->has_permission('send_email')){
            $custom_actions[] =  array('label'=>app::get('b2c')->_('群发邮件'),'submit'=>'index.php?app=b2c&ctl=admin_member&act=send_email','target'=>'dialog::{title:\''.app::get('b2c')->_('群发邮件').'\',width:700,height:400}');
        }
        if($this->has_permission('send_msg')){
            $custom_actions[] =  array('label'=>app::get('b2c')->_('群发站内信'),'submit'=>'index.php?app=b2c&ctl=admin_member&act=send_msg','target'=>'dialog::{title:\''.app::get('b2c')->_('群发站内信').'\',width:500,height:350}');
        }
        if($this->has_permission('send_sms')){
            $custom_actions[] =  array('label'=>app::get('b2c')->_('群发短信'),'submit'=>'index.php?app=b2c&ctl=admin_member&act=send_sms','target'=>'dialog::{title:\''.app::get('b2c')->_('群发短信').'\',width:500,height:350}');
        }

        $actions_base['title'] = app::get('b2c')->_('企业会员列表');
        $actions_base['actions'] = $custom_actions;
        $actions_base['allow_detail_popup'] = true;
        $actions_base['use_buildin_export'] = false;
        $actions_base['use_buildin_set_tag'] = true;
        $actions_base['use_buildin_filter'] = true;
        $actions_base['use_buildin_recycle'] = false;
        $actions_base['finder_aliasname'] ='companyindex';
        $actions_base['base_filter'] = array('user_type'=>1);

        $actions_base['use_view_tab'] = true;
        $actions_base['object_method'] =array('count' => 'get_finder_count', 'getlist' => 'get_finder_company');
        $this -> finder('b2c_mdl_members',$actions_base);
    }

	
}